using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using PBMessage;
public class PBIDMapping 
{
   public IPBHandler HandlerClass;
   public System.Type HandlerType;
   public PBIDMapping(IPBHandler c,System.Type t) 
   {
       HandlerClass = c;
       HandlerType = t;
   }
} 
public class PacketHandlersDic
{
    private Dictionary<PBMessageID, PBIDMapping> Handlers = new Dictionary<PBMessageID, PBIDMapping>();

   public void LoadHandlers() 
   {
       PBIDMapping SC_RetLoginMapping = new PBIDMapping(new SC_RetLogin_Handler(),typeof(SC_RetLogin));
    this.Handlers.Add(PBMessageID.SC_RetLogin,SC_RetLoginMapping);
    PBIDMapping SC_GameHallTickMapping = new PBIDMapping(new SC_GameHallTick_Handler(),typeof(SC_GameHallTick));
    this.Handlers.Add(PBMessageID.SC_GameHallTick,SC_GameHallTickMapping);
    PBIDMapping SC_RetMatchGameMapping = new PBIDMapping(new SC_RetMatchGame_Handler(),typeof(SC_RetMatchGame));
    this.Handlers.Add(PBMessageID.SC_RetMatchGame,SC_RetMatchGameMapping);
    PBIDMapping SC_RetCancelMatchMapping = new PBIDMapping(new SC_RetCancelMatch_Handler(),typeof(SC_RetCancelMatch));
    this.Handlers.Add(PBMessageID.SC_RetCancelMatch,SC_RetCancelMatchMapping);
    PBIDMapping SC_EnterReadyRoomMapping = new PBIDMapping(new SC_EnterReadyRoom_Handler(),typeof(SC_EnterReadyRoom));
    this.Handlers.Add(PBMessageID.SC_EnterReadyRoom,SC_EnterReadyRoomMapping);
    PBIDMapping SC_SynPlayerStateMapping = new PBIDMapping(new SC_SynPlayerState_Handler(),typeof(SC_SynPlayerState));
    this.Handlers.Add(PBMessageID.SC_SynPlayerState,SC_SynPlayerStateMapping);
    PBIDMapping SC_EnterGameSceneMapping = new PBIDMapping(new SC_EnterGameScene_Handler(),typeof(SC_EnterGameScene));
    this.Handlers.Add(PBMessageID.SC_EnterGameScene,SC_EnterGameSceneMapping);
    PBIDMapping SC_BackToGameHallMapping = new PBIDMapping(new SC_BackToGameHall_Handler(),typeof(SC_BackToGameHall));
    this.Handlers.Add(PBMessageID.SC_BackToGameHall,SC_BackToGameHallMapping);
    PBIDMapping SC_SceneTickMapping = new PBIDMapping(new SC_SceneTick_Handler(),typeof(SC_SceneTick));
    this.Handlers.Add(PBMessageID.SC_SceneTick,SC_SceneTickMapping);
    PBIDMapping SC_AbilityAttackMapping = new PBIDMapping(new SC_AbilityAttack_Handler(),typeof(SC_AbilityAttack));
    this.Handlers.Add(PBMessageID.SC_AbilityAttack,SC_AbilityAttackMapping);
    PBIDMapping SC_AbilityMoveMapping = new PBIDMapping(new SC_AbilityMove_Handler(),typeof(SC_AbilityMove));
    this.Handlers.Add(PBMessageID.SC_AbilityMove,SC_AbilityMoveMapping);
    PBIDMapping SC_ExecTriggerMapping = new PBIDMapping(new SC_ExecTrigger_Handler(),typeof(SC_ExecTrigger));
    this.Handlers.Add(PBMessageID.SC_ExecTrigger,SC_ExecTriggerMapping);
    
   }

   public PBIDMapping GetPBHandler(PBMessageID messageID) 
   {
       return this.Handlers[messageID];
   }
   
}
